From: Brion Vibber Date: Wed, 14 Sep 2011 21:38:26 +0000 (+0000) Subject: * (bug 30894) Add --output option to mwdocgen.php to override output directory X-Git-Tag: 1.31.0-rc.0~27654 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=3088982d20c1b881e85e28359b902ffa8ce91650;p=lhc%2Fweb%2Fwiklou.git * (bug 30894) Add --output option to mwdocgen.php to override output directory Note that files go into the 'html' subdir of wherever you point. --- diff --git a/maintenance/mwdocgen.php b/maintenance/mwdocgen.php index ed511f7405..1e0221eb31 100644 --- a/maintenance/mwdocgen.php +++ b/maintenance/mwdocgen.php @@ -180,20 +180,51 @@ function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath, unset( $file ); -if ( is_array( $argv ) && isset( $argv[1] ) ) { - switch( $argv[1] ) { - case '--all': $input = 0; break; - case '--includes': $input = 1; break; - case '--languages': $input = 2; break; - case '--maintenance': $input = 3; break; - case '--skins': $input = 4; break; - case '--file': - $input = 5; - if ( isset( $argv[2] ) ) { - $file = $argv[2]; +if ( is_array( $argv ) ) { + for ($i = 0; $i < count($argv); $i++ ) { + switch( $argv[$i] ) { + case '--all': $input = 0; break; + case '--includes': $input = 1; break; + case '--languages': $input = 2; break; + case '--maintenance': $input = 3; break; + case '--skins': $input = 4; break; + case '--file': + $input = 5; + $i++; + if ( isset( $argv[$i] ) ) { + $file = $argv[$i]; + } + break; + case '--no-extensions': $input = 6; break; + case '--output': + $i++; + if ( isset( $argv[$i] ) ) { + $doxyOutput = realpath( $argv[$i] ); + } + break; + case '--help': + print <<] [] + +Commands: + --all Process entire codebase + --includes Process only files in includes/ dir + --languages Process only files in languages/ dir + --maintenance Process only files in maintenance/ dir + --skins Process only files in skins/ dir + --file Process only the given file + +If no command is given, you will be prompted. + +Other options: + --output Set output directory (default $doxyOutput) + --help Show this help and exit. + + +END; + exit(0); + break; } - break; - case '--no-extensions': $input = 6; break; } }